package com.srcptit.java.training.kienbd.bt1;
import java.util.Scanner;
public class Muc2_Bai1_MangTD {
	Scanner sc=new Scanner(System.in);
	static int a[]=new int[100];
	static int n;
	static void nhap()
	{
            Scanner sc=new Scanner(System.in);
            System.out.print("Nhap so phan tu : ");
            n=sc.nextInt();
            for(int i=1;i<=n;i++)
            {
            	System.out.print("Phan tu thu "+i+" : ");
		a[i]=sc.nextInt();
            }
            sc.close();
	}
	static void sx_tang_dan()
        {
            int hv;
            for(int i=1;i<n;i++)
            for(int j=i;j<=n;j++)
		if(a[i]>a[j])
		{
                	hv=a[i];
            		a[i]=a[j];
			a[j]=hv;
		}
        }
	static void in()
	{
            System.out.print("Mang sap xep tang dan :");
            for(int i=1;i<=n;i++)
            {
            	System.out.print(a[i]+" ");
            }
	}
	public static void main(String args[])
        {
            nhap();
            sx_tang_dan();
            in();
	}
}